package com.cl.short_video_java.web.admin;

import com.cl.short_video_java.common.Result;
import com.cl.short_video_java.service.VideoTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 付
 * @Date 2024-11-13 11:28
 * @Version 1.0
 * @description
 * @since 1.0
 */

@RestController
@RequestMapping("/tag")
public class TagController {

	private VideoTagService videoTagService;

	@Autowired
	TagController(VideoTagService videoTagService) {
		this.videoTagService = videoTagService;
	}

	/**
	 * 批量删除系统
	 *
	 * @param ids
	 * @return
	 */
	@PostMapping("/batch-del")
	@Transactional(rollbackFor = Exception.class)
	public Result batchDel(@RequestBody List<Integer> ids) {
		boolean b = videoTagService.removeBatchByIds(ids);
		return Result.success();
	}
}

